#include<bits/stdc++.h>
using namespace std;
signed main() {
    int k;
    cin >> k;

    int ck = 0;
    string s;
    while(1) {
        cin >> s;
        if(s == "End") break;

        if(ck == k) {
            ck = 0;
            cout << s << "\n";
        } else if(s == "ChuiZi") {
            cout << "Bu\n";
            ck++;
        } else if(s == "Bu") {
            cout << "JianDao\n";
            ck++;
        } else {
            cout << "ChuiZi\n";
            ck++;
        }
    }
    return 0;
}

